def decimal_to_binary(decimal_number):
    binary = ''
    if decimal_number < 0: raise ValueError("Number cannot be negative")
    if decimal_number == 0: return "0"
    while decimal_number > 0:
        binary = str(decimal_number % 2) + binary
        decimal_number >>= 1
    return binary

def binary_to_decimal(binary_string):
    return long(binary_string, 2)